[ESSIMAGING] Move tiff dumping method to essimaging and make it more generic. - #737
[ESSIMAGING] Move tiff dumping method to essimaging and make it more generic.#737YooSunYoung wants to merge 5 commits into
Conversation
| pulse_period: sc.Variable, | ||
| ) -> sc.Variable: | ||
| _pulse_period = pulse_period.to(unit=event_time_zero.unit) | ||
| etz = event_time_zero - sc.datetime(0, unit=event_time_zero.unit) |
There was a problem hiding this comment.
Do we also here have the same problem as in essreduce: we don't know if the first event_time_zero in the file was at the start of a frame_period, or half-way through a frame_period (i.e. should the index be [0, 1, 0, 1, ...], or should it be [1, 0, 1, 0, ...]?)
There was a problem hiding this comment.
Yes we potentially do.
But we wanted to keep this method naiive and stupid though.
Maybe we can just add a keyword argument that fixes the start of the index...?
There was a problem hiding this comment.
Maybe we can just add a keyword argument that fixes the start of the index...?
Yes, do that. And have it set to 0 by default.
In the generic workflow, it's called pulse_stride_offset: PulseStrideOffset.
There was a problem hiding this comment.
Still missing this part and then we can merge.
| import scitiff | ||
| from tifffile import imwrite | ||
|
|
||
| from ess.imaging.io import _add_to_event_time_offset_in_case_of_pulse_skipping |
There was a problem hiding this comment.
Can we also import tiff_from_event_data and then just wrap the function here and add the deprecation warning instead of duplicating all the function code in this file also?
| ), | ||
| sc.array(dims='t', values=[0, 1.0, 0], unit='s'), | ||
| ) | ||
| assert_identical( |
There was a problem hiding this comment.
I don't want to drag this on any longer than it needs to, but ideally I would say this test should be split into 5 tests, so that we can know quickly from the pytest output which is the case that is failing.
The existing method is not compatible with the new(fixed) nexus format anymore.
And I made it a bit more generic so that both TBL and ODIN can use them.
Related to the code shelf notebook: https://git.esss.dk/dram/code-shelf/code-shelf/-/blob/main/src/odin/notebooks/nexus_to_tiff.ipynb?ref_type=heads